home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / objcissu.lha / distributed-objects < prev    next >
Text File  |  1993-03-01  |  12KB  |  222 lines

  1. Date: Fri, 11 Sep 92 12:20:20 -0500
  2. From: wiltel!clloyd@uunet.uu.net
  3. To: uunet!prep.ai.mit.edu!gnu-objc@uunet.uu.net
  4. Subject: OO Runtime, Proxy Considerations
  5.  
  6. Hello all,
  7.  
  8. Here are a few ideas on topics which have caused problems in the past.  I think there may be an opportunity to affect an improvement, so here are a few suggestions.
  9.  
  10. Suggestion for runtime environment.
  11.  
  12. As I understand it, dennis_glatting@trirex.com is going to provide the runtime environment for the Objective-C.  As one who has developed an Object inspector which displays the runtime information of any object, let me strongly recommend that the access to the runtime environment be object oriented.  NeXT's set of runtime functions and non-object-oriented data structures made my job much harder than it needed to be.  Had the runtime itself been object oriented, building an object inspector would have been a no-brainer.  More importantly, future enhancements to the runtime system would go smoother if it were object oriented.
  13.  
  14. If its too late to go object oriented with the runtime environment (for whatever reason), I may be able to offer a set of wrappers which makes the runtime appear to be object oriented;  but I would not recommend this as the ideal approach.  Also, my code is wholly dependent on the NeXT runtime environment, so it would need to be adapted (not to mention completed).
  15.  
  16.  
  17.  
  18. Suggestion for Proxy hierarchy:
  19.  
  20. Currently, NeXT has only one class of object proxy, "NXProxy."  NXProxy is its own root in a new hierarchy, but it is intended for use as a Distributed Object proxy.  This approach is very short-sighted as there are actually many needs for different types of proxies (we use three different types of proxy for three very different purposes here at WilTel).
  21.  
  22. I propose that the gnu Object hierrarchy come with a parallel hierarchy called proxy_Object.  The proxy_Object class is a complete re-implementation of the Object class in which every method (except forward::) is renamed to "proxy_methodName:" where methodName: is the corresponding name in the Object class.  The proxy_Object class would serve as the superclass to all proxy classes and those application-specific proxy subclasses should add their own behavior.  This way, the programmer can communicate directly with the proxy by using the "proxy_" convention and all proxies would have a common ancestor.
  23.  
  24.  
  25. NOTE:  NeXT's (and WilTel's) current approach to proxies is the brute force approach (ie depends on forward::).  I believe the proxy concept is powerful enough to warrant a completly fresh approach and possible inclusion in the language itself.  A clever implemention of objc_msgSend() could take proxies into consideration and, with some minor additional syntax, programmers could communicate with proxies or the actual target in a much more efficient way.  If the language itself were aware of the proxy concept, there would be no reason to implement the proxy_Object hierarchy as a parallel universe.  Here's some possible syntax which would tell objc_msgSend() how to do its lookup:
  26.  
  27.     //Send a message to the proxy itself
  28.     [someProxy @proxyMsg(doSomething)];
  29.  
  30.     //Send a message intended for the target of the proxy
  31.     [someProxy doSomething];
  32.  
  33.     //Send a message to the real thing
  34.     [someRealObject doSomething];
  35.  
  36. If done properly, this could avoid the inefficient practice of using forward::.  Perhaps a class which conformsTo: the "Proxy" protocol would be treated as a proxy by objc_msgSend(), else its treated as the real thing.  The "Proxy" protocol might define a single method which does whatever forward:: would otherwise do.
  37.  
  38. Just some thoughts,
  39. Charles Lloyd
  40.  
  41. Newsgroups: comp.sys.next.software,comp.sys.next.programmer
  42. From: burchard@horizon.math.utah.edu (Paul Burchard)
  43. Subject: Re: distributed objects? (Plusses & minuses of NeXT's design)
  44. Date: Thu, 24 Sep 1992 01:32:42 GMT
  45.  
  46. In article <5123@rosie.NeXT.COM> sam_s@NeXT.com (Sam Streeper) writes:
  47. > Basically distributed objects allows objects in one application to be sent  
  48. > messages from any number other applications, as though the object were local  
  49. to  
  50. > those applications.  The system is pretty transparent; when you return an  
  51. > object to a remote application, "it just works".  In fact, it's easy enough  
  52. > that you sometimes forget you're using it.  Returning self really returns the  
  53. > object to any application that asks!
  54. > Distributed objects makes RPC programming simple; remote messages look just  
  55. > like local objective-c messages.
  56.  
  57. I think Distributed Objects is one of the greatest features of 3.0.  It opens  
  58. up a whole new world of separate but "virtually integrated", interacting  
  59. programs, which is very important to making computers really useful in  
  60. mathematics.
  61.  
  62. However, I feel that there is one glaring flaw in the design of 3.0 D.O.'s.   
  63. The set of message parameter types supported is just not broad enough to make  
  64. things really transparent.  What about RtMatrix?  NXEvent pointers?  And other  
  65. similar small but complex by-reference and union parameters?
  66.  
  67. Unfortunately, because the type encoding logic is contained in the  
  68. communications objects rather than in the types themselves, the system does not  
  69. lend itself to user-supplied extensions to overcome these problems.  Secondly,  
  70. the compiler/runtime in certain cases only record promoted type descriptions  
  71. despite explicit declarations otherwise.  For example,
  72.     typedef float vector[3];
  73.     - getVector:(vector)v;
  74. Yields the type desciptor "^f" rather than the correct "^[3f]" for its first  
  75. argument.  This makes it impossible to fix the problem with array arguments  
  76. after the fact.
  77.  
  78. I am experimenting with my own Objective-C (socket-based) D.O. system, in which  
  79. there is a user-extensible class hierarchy of object wrappers for C types (used  
  80. only during communication of course).  I can do most of this on top of the  
  81. existing run-time and compiler, but to see the full potential the compiler  
  82. would need to generate better type descriptions, especially for array types.  
  83.  
  84. I specifically want to be able to transparently and remotely manipulate 3-D  
  85. objects, and so RtMatrix args for Renderman calls are essential.  I'd also like  
  86. it portable to the GNU Obj-C runtime, which is why I'm using sockets.
  87.  
  88. Anyone else thinking about this stuff?
  89.  
  90. --
  91. --------------------------------------------------------------------
  92. Paul Burchard    <burchard@geom.umn.edu>
  93. ``I'm still learning how to count backwards from infinity...''
  94. --------------------------------------------------------------------
  95.  
  96. Date: Tue, 13 Oct 1992 15:05:36 -0400
  97. From: Pascal Gaudette <pascal@nextasy.physics.mcmaster.ca>
  98. To: gsk@world.std.com (Geoffrey S Knauth)
  99. Subject: Re: GNU Objective-C projects
  100.  
  101.  
  102. In comp.lang.objective-c article <BvrDLF.AKq@world.std.com> you wrote:
  103.  
  104. > The GNU Objective-C project team is working on a runtime
  105. > system, easy access to C++ from Objective-C, a class
  106. > library, and a graphical interface builder.
  107. >
  108.  
  109. Yes, and I think that you guys deserve a big dose of praise
  110. for taking this on. But I have a small question:
  111.  
  112. Have you given any thought to making a GNU version of the
  113. distributed objects system that NeXT has unveiled with
  114. 3.0? (ie NXConnection and NXProxy) This would be really
  115. great in that it would allow developers to easily write
  116. distributed apps in heterogeneous environments. I realize
  117. that this would really not be an easy task, in that
  118. a lot of the NeXT distributed objects stuff probably
  119. relies on mach specific stuff. I would just like to know if
  120. it has been thought of at all.
  121.  
  122. Thanks for any info,
  123. --
  124. Pascal "The Rascal" Gaudette       pascal@nextasy.physics.mcmaster.ca
  125. MacNUG president                      | *NeXTmail encouraged*
  126. graduate student, McMaster university | Je ne suis pas infaillible.
  127. Physics and astronomy dep.            | Vive le Quebec LIBRE!
  128.  
  129. To: "Geoffrey S. Knauth" <gsk@marble.com>
  130. Cc: gnu-objc@prep.ai.mit.edu, petrilli@hal.gnu.ai.mit.edu
  131. Subject: Re: thinking ahead toward distributed objects 
  132. In-Reply-To: (Your message of Sat, 02 Jan 93 17:08:02 EST.)
  133.              <199301022208.AA00895@carrara> 
  134. Date: Sat, 02 Jan 93 20:38:07 -0600
  135. From: Chris Petrilli <petrilli@gnu.ai.mit.edu>
  136.  
  137.  
  138. >>>>> "KAS" == Kevin A. Sapp <sapp@sawdust.ssc.gov> writes (abridged):
  139. KAS> I am also trying to put together a FIRST CLASS object that can be
  140. KAS> queried (using standard objective-c syntax) about itself...how many
  141. KAS> instance variables do you have, what is the name of the 2nd one, type
  142. KAS> of 2nd one, ...  This would be the base class of a remote object (with
  143. KAS> some additional methods).
  144.  
  145. Seems like a reasonable way to do this.  I am curious exactly how NeXT
  146. has built this into NeXTstep, although I do know they have used RPC
  147. (Remote Proceedure Call) syntax instead of Mach messages, which seems
  148. to say to me that they are trying to be a little more portable in
  149. theory.
  150.  
  151. KAS> I beleive these are the first steps toward distributed/remote objects.
  152. KAS> Once one can access an objects instance variable, class, and method
  153. KAS> information at runtime the information is there now the transfer of
  154. KAS> this data (ala @encode strings for processor independance), method
  155. KAS> existance, invocation and return values are some of the remaining
  156. KAS> challanges.
  157.  
  158. Yeah, the other thing is a "standard" protocol between objects for the
  159. communication of information.
  160.  
  161. >>>>> On Sat, 2 Jan 93 17:08:02 -0500, "Geoffrey S. Knauth"
  162. >>>>> <gsk@marble.com> said:
  163.  
  164. GAK> Kevin, you have some good ideas.  One way to see them included in GNU
  165. GAK> Objective-C is to grab the GCC 2.3.2 sources from prep.ai.mit.edu and
  166. GAK> add your changes to the base object.  We are accepting submissions via
  167. GAK> gnu-objc-submissions@prep.ai.mit.edu.
  168.  
  169. GCC 2.3.3 now, but yea... and send information to the map project as
  170. well, so that we can coordinate everything from our end.
  171.  
  172. Chris
  173.  
  174. To: Steve Naroff <Steve_Naroff@next.com>
  175. Cc: "Geoffrey S. Knauth" <gsk@marble.com>, gnu-objc@prep.ai.mit.edu
  176. Subject: Re: thinking ahead toward distributed objects 
  177. In-Reply-To: (Your message of Mon, 04 Jan 93 11:37:34 PST.)
  178.              <9301041938.AA06651@oz.NeXT.COM> 
  179. Date: Mon, 04 Jan 93 14:08:04 -0600
  180. From: Chris Petrilli <petrilli@gnu.ai.mit.edu>
  181.  
  182.  
  183. >>>>> On Mon, 4 Jan 93 11:37:34 -0800, Steve Naroff
  184. >>>>> <Steve_Naroff@NeXT.COM> said:
  185.  
  186. Steve> This is not true (in version 3.0 of NeXTSTEP)...the syntax used is  
  187. Steve> plain old Objective-C. 
  188.  
  189. What I meant is that they were using RPC methodology underneath the
  190. whole thing to actually accomplish the work.  I've heard from 2 people
  191. at NeXT ... one says RPC (ie Sun ONC), and the other says Mach
  192. messages.  I can't seem to get a straight answer from anyone.
  193.  
  194. Either way, RPC is the only real option for the GNU project since we
  195. have to be a bit more portable.  Given that the GNU system will
  196. eventually one day run on top of Mach, that would be nice, but I think
  197. that RPC is a better choice for now, since the speed isn't much worse,
  198. and the portability is MUCH better.
  199.  
  200. Steve> The Objective-C compiler and runtime work together to help
  201. Steve> implement this functionality. The Object class publishes a
  202. Steve> method named "forward::" to implement "proxies". The
  203. Steve> Objective-C language implements "protocols" to help obtain type
  204. Steve> information when the class is not local. If a protocol does not
  205. Steve> exist, things still work, they are just a bit slower...
  206.  
  207. Minor correction: these are extensions that NeXT added to Objective-C
  208. as far as I know, as I don't think the latest release of StepStone
  209. will support @protocol, etc... in addition, we're STILL waiting on
  210. access to the NeXT Objective-C front end so that we can integrate it
  211. into later releases of GCC.  Any word on when we get access?  it's
  212. really annoying to ME personally, not to be able to use various things
  213. together.  I run GCC 2.3.3 for my own code (ie, non Objective-C most
  214. of the time), but have to stick with the antiquated NeXT CC for
  215. Objective-C... gods forbid I have to integrate Objective-C and C++ and
  216. want an ANSI compliant C++ compiler (which NeXT does not ship).
  217.  
  218. Chris
  219.  
  220.  
  221.